<?php

//session_start();
include_once "haut.php";
include_once "metier/connexion.php";

redirigerSiNonConnecte();

include_once "metier/XSRF.php";

include_once "haut.php";

?>

<div>
	<?php notifications(); ?>
	<fieldset>
		<legend>Creer une annonce</legend>
		<form method="post" action="gestionCreationAnnonce.php" enctype="multipart/form-data">
			<table>
				<tr>
					<td>
						<label for="titre">Titre de l'annonce*</label>
					</td>
					<td>
						<input type="text" name="titre" id="titre"/>
					</td>
				</tr>
				<tr>
					<td>
						<label for="description">Description*</label>
					</td>
					<td>
						<textarea name="description" id="description"></textarea>
					</td>
				</tr>
				<tr>
					<td>
						<label for="prix">Prix</label>
					</td>
					<td>
						<input type="number" name="prix" id="prix" value="0"/>
					</td>
				</tr>
				<tr>
					<td>
						<label for="adresse">Adresse</label>
					</td>
					<td>
						<input type="text" name="adresse" id="adresse"/>
					</td>
				</tr>
				<tr>
					<td>
						<label for="image">Image (taille max: 50 KB)</label>
					</td>
					<td>
						<input type="file" name="img" id="img"/>
					</td>
				</tr>
				<tr>
					<td>
						<label for="categorie">Categorie</label>
					</td>
					<td>
						<select name="categorie" id="categorie">
							<option value="vehicules">Vehicules</option>
							<option value="immobilier">Immobilier</option>
							<option value="multimedia">Multimedia</option>
							<option value="maison">Maison</option>
							<option value="loisirs">Loisirs</option>
							<option value="emploiservices">Emploi/Services</option>
						</select>
					</td>
				</tr>
				<tr>
					<td><input type="submit"/></td>
					<td><input type="reset"/></td>
				</tr>
			</table>
			<input type="hidden" name="token" value="<?php echo genererToken("CREATION_ANNONCE", 1); ?>"/>
		</form>
	</fieldset>
</div>

<?php
include_once "bas.php";
?>